{% extends 'admin/layout.html' %}
{% import 'admin/_macros.html' as lib with context %}
{% set name = admin_view.get_display_name() %}

{% block head_css %}
    <link href="{{ url_for('admin.static', filename='chosen/chosen.css') }}" rel="stylesheet">
    <link href="{{ url_for('admin.static', filename='css/datepicker.css') }}" rel="stylesheet">
    {{super()}}
{% endblock %}

{% block body %}
    <h1 id="main-title">{{ _gettext('Add %(model)s',model=name|capitalize) }}</h1>
    <div class="clearfix"></div>
    <hr />

    <div class="page-content">
        {% macro extra() %}
            <input name="_add_another" type="submit" class="btn" value="{{ _gettext('Save and create other') }}" />
            <input name="_edit" type="submit" class="btn" value="{{ _gettext('Save and stay on page') }}" />
        {% endmacro %}

        {{ lib.render_form(form, extra(), admin_view.can_edit, admin_view.can_delete) }}
    </div>
{% endblock %}

{% block tail %}
    <script src="{{ url_for('admin.static', filename='js/bootstrap-datepicker.js') }}"></script>
    <script src="{{ url_for('admin.static', filename='js/form.js') }}"></script>
{% endblock %}
